@echo off
echo 🚀 启动PP-OCR Python服务...
echo.

REM 检查Python是否安装
python --version >nul 2>&1
if %errorlevel% neq 0 (
    echo ❌ Python未安装！
    echo 💡 请先安装Python 3.8+: https://www.python.org/downloads/
    pause
    exit /b 1
)

echo ✅ Python已就绪
python --version
echo.

REM 检查PaddleOCR是否安装
python -c "import paddleocr" >nul 2>&1
if %errorlevel% neq 0 (
    echo 📦 PaddleOCR未安装，正在安装...
    pip install paddleocr flask pillow numpy
    if %errorlevel% neq 0 (
        echo ❌ PaddleOCR安装失败！
        echo 💡 请手动运行: pip install paddleocr flask pillow numpy
        pause
        exit /b 1
    )
)

echo ✅ PaddleOCR已就绪
echo.

echo 🔄 启动PP-OCR HTTP服务...
echo 💡 首次运行会下载模型文件，请耐心等待...
echo.

REM 启动服务
python start-ppocr-simple.py

pause